<!--suppress ALL -->
<template>
    <div class="page moreDectorState-page" data-page="moreDectorState" style="z-index: 2;">
        <div class="link-page-nav">
            <a href="#" class="link" @click="$root.backToTab()">
                <i class="iconfont icon-zuo"></i>
            </a>
        </div>
        <div class="link-page-search">
            <div class="moreDectorState_title" style="float: left">远程控制</div>
            <div class="link-page-search-input" style="width: 52%">
                <i class="iconfont icon-APPicon_sousuo1"></i>
                <input type="text" placeholder="搜一搜" id="moreDectorStateSearch_{{getNewId}}">
            </div>
            <a class="link popover-open" data-popover="#dector_menu_{{getNewId}}">
                <i class="iconfont icon-APPicon_shaixuan1" id="active_{{getNewId}}" style="font-size:24px"></i>
            </a>
        </div>
        <div class="select-option-fixed">
            <div class="row unitStat-type-decter" id="unitStat-type-decter_{{getNewId}}"
                style="justify-content: flex-start;">
                <!-- <div class="col unitStat-type-decter-select" data-type="1" @click="selectViewType(1)"
                    style="width: auto;padding: 0 10px;">触发</div>
                <div class="col" data-type="0" @click="selectViewType(0)"
                    style="width: auto;padding: 0 10px;margin-left:20px;">全部</div> -->
            </div>
        </div>
        <div class="page-content infinite-scroll-content ptr-content" id="page-content_{{getNewId}}"
            @ptr:refresh="refreshCurrentList" @infinite="loadMoreDectorList" data-infinite-distance="50"
            style="width:100%">
            <div class="ptr-preloader" style="top: -10px;">
                <div class="preloader color-multi"></div>
                <div class="ptr-arrow"></div>
            </div>
            <div class="list media-list unitStat-list-dslist no-hairline-bottom search-list searchbar-found"
                id="dslist_{{getNewId}}">
                <ul></ul>
                <div id="dector_preloader_{{getNewId}}" class="preloader infinite-scroll-preloader"></div>
            </div>
        </div>
        <div class="popover select-option-con" id="dector_menu_{{getNewId}}">
            <div class="popover-angle"></div>
            <div class="popover-inner">
                <div class="list">
                    <ul>
                        <li><a href="" class="list-button item-link popover-close" id="dector_org_{{getNewId}}">选择单位</a>
                        </li>
                        <li><a href="" class="list-button item-link popover-close select-active"
                                id="dector_type_{{getNewId}}">全部</a></li>
                        <li><a href="" class="list-button item-link popover-close removeScreen select-active"
                                @click="removeScreen">清&nbsp&nbsp&nbsp&nbsp&nbsp空</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
    return {
        mounted() {
            var self = this;
            var app = self.$app;
            self.decterOrgId = this.$route.params.orgid;
            if (equipIndex == -1) {
                equipIndex = this.$route.params.fireTType;
            }
            if (this.$route.params.fcfCategoryId) {
                self.decterSystemId = -1;
                self.selectOptionDec = this.$route.params.fcfCategoryId;
                self.fcfCategoryId = this.$route.params.fcfCategoryId;
                jQuery("#dector_type_" + self.getNewId).html(this.$route.params.fcfCategoryName);
                jQuery("#dector_type_" + self.getNewId).addClass('select-active');
                self.clearContent();
            }

            //九小用户
            if (jQuery.inArray(userInfor.role[0].id, nineUserId) > -1) {
                self.getNineMarkData();
            }
        },
        data: function () {
            return {
                decterOrgId: 0,
                firettype: 0,
                fireTType: -1,
                decterSystemId: -1,
                decterFbsId: 0,
                allowInfinite: true,
                fcfCategoryId: -1, //设备类别-1;
                listIndex: 0,
                listSize: 25,
                selectContent: '',
                selectOptionOrg: "",
                selectOptionDec: "",
                nineFcfId: "",
                getNewId: (new Date()).getTime()
            }
        },
        methods: {
            getSendCommandFcsCategoryList(callback) {
                Dao.getSendCommandFcsCategoryList({}, function (data) {
                    callback(data)
                })
            },
            backToRefresh: function () {
                var self = this;
                self.clearContent();
                self.equipment_material()
            },
            equipment_material() {
                let self = this
                let getAlarming = JSON.parse(localStorage.getItem("equipment_material"))
                let getAlarmingIds = getAlarming.fcFacilitiesId
                let getAlarmingId = []
                if (getAlarmingIds.toString().indexOf(",") == -1) {
                    getAlarmingId = [getAlarming.fcFacilitiesId]
                } else {
                    getAlarmingId = getAlarming.fcFacilitiesId.split(",")
                }
                let $ul = $("#dslist_" + self.getNewId + " ul").children()
                for (let i = 0; i < $ul.length; i++) {
                    for (let j = 0; j < getAlarmingId.length; j++) {
                        if (getAlarmingId[j] == $ul.eq(i).attr("id")) {
                            if (getAlarming.isConcern == 1) { // 关注
                                $ul.eq(i).find(".decter-stuts-con>a").show()
                            } else { // 取消关注
                                $ul.eq(i).find(".decter-stuts-con>a").hide()
                            }
                            if (getAlarming.handleStatus == -1) { // 未处理
                                $ul.eq(i).find(".decter-stuts-con>span>label").html("&nbsp;&nbsp;&nbsp;未处理")
                            } else if (getAlarming.handleStatus == 1) { // 已处理
                                $ul.eq(i).find(".decter-stuts-con>span>label").html("&nbsp;&nbsp;&nbsp;已处理")
                            } else if (getAlarming.handleStatus == 2) { // 处理中
                                $ul.eq(i).find(".decter-stuts-con>span>label").html("&nbsp;&nbsp;&nbsp;处理中")
                            }
                        }
                    }
                }
            },
            //九小用户登录 获取九小用户消防设施
            getNineMarkData: function () {
                var self = this;
                var fcfIdArr = [];
                Dao.selectVenuesRelateInfo_ajax({
                    userName: userInfor.accountName,
                    deviceId: appKeyObj.deviceId,
                    venuesId: nineCode,
                    relateObjType: 1
                }, function (data) {
                    if (data && data.fcfsList.length > 0) {
                        for (var i = 0; i < data.fcfsList.length; i++) {
                            fcfIdArr.push(data.fcfsList[i].id);
                        }
                        self.nineFcfId = fcfIdArr.toString();
                    }
                }, false);
            },
            removeScreen: function () {
                var self = this;
                if (userInfor.isMuilUnitUser == 1) { //多
                    self.selectOptionOrg = "";
                    if (single_Orgid == "") {
                        self.decterOrgId = userInfor.organizationIds;
                    } else {
                        self.decterOrgId = single_Orgid;
                    }
                    jQuery("#dector_org_" + self.getNewId).html("选择单位");
                    jQuery("#dector_org_" + self.getNewId).removeClass('select-active');
                }
                self.selectOptionDec = "";
                self.decterSystemId = -1;
                self.firettype=0
                self.selectOptionUseIndex = '1'
                jQuery("#dector_type_" + self.getNewId).html("全部");

                self.reInit();
                self.clearContent();
                self.getmoreDectorStateData();
            },
            selectViewType: function (type) {
                if (getClickEnabel(500)) {
                    moreDectorStateIndex = type;
                    this.selectCurrentType(type);
                    this.getmoreDectorStateData();
                }
            },
            selectCurrentType: function (type) {
                var self = this;
                var $ = self.$$;
                self.reInit();
                $("#unitStat-type-decter_" + self.getNewId + " div").removeClass('unitStat-type-decter-select');
                $('#unitStat-type-decter_' + self.getNewId + ' div[data-type="' + type + '"]').addClass(
                    'unitStat-type-decter-select');
                self.firettype = type;
                equipIndex = type;
            },
            //列表数据
            getmoreDectorStateData: function () {
                var self = this;
                var $ = self.$$;
                //筛选按钮有值变色
                if (jQuery("#dector_type_" + self.getNewId)[0].innerText != "设备类别" || jQuery("#dector_org_" + self
                        .getNewId)[0].innerText != "选择单位") {
                    jQuery("#active_" + self.getNewId).addClass("select-active");
                } else {
                    jQuery("#active_" + self.getNewId).removeClass("select-active");
                }

                if (self.firettype == 0) { //全部
                    self.fireTType = -1;
                } else if (self.firettype == 1) { //报警
                    self.fireTType = 10;
                } else if (self.firettype == 2) { //故障
                    self.fireTType = 20;
                } else if (self.firettype == 3) { //屏蔽
                    self.fireTType = 30;
                } else if (self.firettype == 4) { //联动
                    self.fireTType = 40;
                } else if (self.firettype == 5) { //正常
                    self.fireTType = 0;
                }
                Dao.getRemoteFcfStatusList({
                    fcfCategoryId: self.fcfCategoryId,
                    orgIds: self.decterOrgId,
                    systemId: self.decterSystemId,
                    fbsId: self.decterFbsId,
                    fireTType: self.fireTType,
                    pageIndex: self.listIndex,
                    pageSize: self.listSize,
                    name: self.selectContent,
                    fcfId: self.nineFcfId,
                }, function (data, total) {
                    if (self.listIndex == 0) {
                        $("#dslist_" + self.getNewId + " ul").empty();
                    }
                    var datalist = data;
                    var dealResultHtml = '';
                    if (datalist && datalist.length > 0) {
                        if (total < self.listSize) {
                            $('#dector_preloader_' + self.getNewId).hide();
                            self.allowInfinite = false;
                        } else {
                            $('#dector_preloader_' + self.getNewId).show();
                            self.allowInfinite = true;
                        }
                        if (datalist.length > 0) {
                            for (var i = 0; i < datalist.length; i++) {
                                datalist[i].fcFacilitiesId=datalist[i].id
                                if (data[i].handleStatus == -1) {
                                    dealResultHtml = `<label id="handleStatus_` + datalist[i]
                                        .fcFacilitiesId + '_' + self.getNewId +
                                        `">&nbsp;&nbsp;&nbsp;未处理</label>`;
                                } else if (data[i].handleStatus == 1) {
                                    dealResultHtml = `<label id="handleStatus_` + datalist[i]
                                        .fcFacilitiesId + '_' + self.getNewId +
                                        `">&nbsp;&nbsp;&nbsp;已处理</label>`;
                                } else {
                                    dealResultHtml = `<label id="handleStatus_` + datalist[i]
                                        .fcFacilitiesId + '_' + self.getNewId +
                                        `">&nbsp;&nbsp;&nbsp;处理中</label>`;
                                }
                                var dataFireType = datalist[i].realTimeStatus;
                                datalist[i].fireTType=dataFireType

                                // if(data[i].isConcern==1){
                                $("#dslist_" + self.getNewId + " ul").append(`
                                    <li id="` + datalist[i].fcFacilitiesId + `">
                                        <div class="decter-stuts-con">
                                            <a class="stick" href="#" id="hwy` + datalist[i].fcFacilitiesId + '_' +
                                    self.getNewId + `" @click="optionFlow" style="color:#999;display:none">
                                                    <i class="iconfont icon-APPicon_guanzhu iconfont-focus" id="hwy_` +
                                    self.getNewId + `" style="font-size:20px;color:red;"></i>
                                            </a>
                                            <span class='left' style="color:` + transFireColor(dataFireType) + `${dataFireType==10?'':';display:none'};">
                                                <i id="fireType-` + datalist[i].fcFacilitiesId + '_' + self.getNewId +
                                    `" class="iconfont ` + transNewFireIcon(datalist[i].fireTType) +
                                    `" ></i>
                                                ` + (datalist[i].fireTType == 10 ? '触发' : '') + `
                                            </span>
                                        </div>
                                        <a id="jump_to_eqmentMsg_` + datalist[i].fcFacilitiesId + '_' + self.getNewId + `" href="#" class="item-link item-content" data-view=".view-main" style="flex:1;padding-left:0;">
                                            <div class="decter-pic-con" id="dectorImg_` + datalist[i].fcFacilitiesId +
                                    `_` + self.getNewId + `"></div>
                                        <div class="item-inner" style="padding: 0;">
                                            <div class="item-title-row" style="padding-right: 0;">
                                                <div class="item-title decter-name-con">
                                                    <span class="decter-name">` + common.transNullundefinedToline(
                                        datalist[i].name) + `</span>
                                                </div>
                                            </div>
                                            <div class="item-subtitle decter-belong-unit" id="decter-belong-unit_` +
                                    self.getNewId + `">
                                                ` + common.transNullundefined(datalist[i].organizationName) + `
                                            </div>
                                            <div class="item-subtitle decter-mesage">` + common.transNullundefined(
                                        datalist[i].location) + `</div>
                                            
                                        </div>
                                        
                                    <div><div id="btnRemoteControl` + datalist[i].fcFacilitiesId + '_' + self.getNewId +
                                    `" class="right" style="font-size:10px;padding: 8px 0px;background: #fe6668;color:#fff;border-radius: 15px;width:70px;text-align:center;" data-id = ` +
                                    data[i].fcFacilitiesId + `
                                            data-type = "1">启用</div>
                                            <div id="btnRemoteControl2` + datalist[i].fcFacilitiesId + '_' + self.getNewId +
                                    `" class="right" style="margin-top:10px;font-size:10px;padding: 8px 0px;background: #397ECE;color:#fff;border-radius: 15px;width:70px;text-align:center;" data-id = ` +
                                    data[i].fcFacilitiesId + `
                                            data-type = "0">关闭</div></div>
                                        </a>
                                    </li>
                                    `);
                                //关注是否显示
                                if (data[i].isConcern == 1) {
                                    jQuery("#hwy" + datalist[i].fcFacilitiesId + '_' + self.getNewId)
                                        .show();
                                } else if (data[i].isConcern == 0) {
                                    jQuery("#hwy" + datalist[i].fcFacilitiesId + '_' + self.getNewId)
                                        .hide();
                                }
                                $("#isFocus-" + datalist[i].fcFacilitiesId).css("color", "#F02020");
                                if (dataFireType == 0) { //正常隐藏，其他状态显示
                                    $("#handleStatus_" + datalist[i].fcFacilitiesId + '_' + self.getNewId)
                                        .hide();
                                } else {
                                    $("#handleStatus_" + datalist[i].fcFacilitiesId + '_' + self.getNewId)
                                        .show();
                                }
                                //跳转
                                jQuery("#jump_to_eqmentMsg_" + datalist[i].fcFacilitiesId + '_' + self
                                    .getNewId).off().on("click", {
                                    'res': datalist[i]
                                }, function (e) {
                                    let eobj=e.data.res
                                    localStorage.setItem("equipment_material", JSON.stringify(eobj))
                                    app.router.navigate(`/eqmentMsg/` + e.data.res.fcFacilitiesId +
                                        `/`);
                                })
                                // 启用/关闭
                                jQuery("#btnRemoteControl" + datalist[i].fcFacilitiesId + '_' + self
                                    .getNewId).off().on("click", {
                                    'res': datalist[i]
                                }, function (e) {
                                    e.stopPropagation()
                                    Dao.alarmCallById({
                                        facId: e.currentTarget.getAttribute('data-id'),
                                        alarmType: e.currentTarget.getAttribute('data-type')
                                    }, function (res) {
                                        app.methods.showToastCenter("操作成功");
                                    })
                                })
                                jQuery("#btnRemoteControl2" + datalist[i].fcFacilitiesId + '_' + self
                                    .getNewId).off().on("click", {
                                    'res': datalist[i]
                                }, function (e) {
                                    e.stopPropagation()
                                    Dao.alarmCallById({
                                        facId: e.currentTarget.getAttribute('data-id'),
                                        alarmType: e.currentTarget.getAttribute('data-type')
                                    }, function (res) {
                                        app.methods.showToastCenter("操作成功");
                                    })
                                })
                                //展示图片
                                showImage(jQuery("#dectorImg_" + datalist[i].fcFacilitiesId + `_` + self
                                    .getNewId), datalist[i].categoryPicUrl, 1);
                            }

                            if (userInfor.isMuilUnitUser == 0) {
                                jQuery(".decter-belong-unit_" + self.getNewId).hide();
                            } else {
                                //是多联网角色切换到单的
                                if (isChangeUnitRole) {
                                    jQuery(".decter-belong-unit_" + self.getNewId).hide();
                                } else {
                                    jQuery(".decter-belong-unit_" + self.getNewId).show();
                                }
                            }
                        }
                    } else {
                        self.allowInfinite = false;
                        $('#dector_preloader_' + self.getNewId).hide();
                        if (self.listIndex == 0) { //暂无数据
                            $("#dslist_" + self.getNewId + " ul").empty();
                            $("#dslist_" + self.getNewId + " ul").append(
                                `<div class="no-data-img"><img src="` + listNoDataPic() + `"/></div>`);
                        }
                    }
                });
            },
            //关注
            optionFlow: function (data) { //关注和取消关注事件
                var self = this;
                if (data.isConcern == 1) { // 取消关注
                    app.params.dialog.buttonCancel = "取消";
                    app.params.dialog.buttonOk = "确认";
                    // app.dialog.confirm('确认取消关注此设备?', '确认', function() {
                    //取消关注
                    common.loading(1);
                    Dao.focusOnOff({
                        userAccount: userInfor.accountName,
                        userName: userInfor.accountName,
                        deviceId: appKeyObj.deviceId,
                        type: 1,
                        concemId: data.fcFacilitiesId,
                    }, function (data) {
                        common.loading(0);
                        app.methods.showToastCenter("取消关注成功");
                        self.isConcern = 0;
                        self.getmoreDectorStateData();
                    }, function (e) {
                        common.loading(0);
                        app.methods.showToastCenter("取消关注失败");
                    });
                    // });
                } else {
                    common.loading(1);
                    Dao.addUserConcem({
                        userName: userInfor.accountName,
                        deviceId: appKeyObj.deviceId,
                        userAccount: userInfor.accountName,
                        type: 1,
                        concemId: data.fcFacilitiesId,
                    }, function (data) {
                        common.loading(0);
                        app.methods.showToastCenter("关注成功");
                        self.isConcern = 1;
                        self.getmoreDectorStateData();
                    }, function (e) {
                        common.loading(0);
                        app.methods.showToastCenter("关注失败");
                    });
                }
            },
            loadMoreDectorList: function () {
                var self = this;
                var $ = self.$$;
                if (self.allowInfinite) {
                    if (!self.allowInfinite) return;
                    self.allowInfinite = false;
                    setTimeout(function () {
                        self.listIndex++;
                        self.getmoreDectorStateData();
                    }, 1000);
                }
            },
            refreshCurrentList: function (e, done) {
                var self = this;
                var $ = self.$$;
                if (done && e) {
                    setTimeout(function () {
                        self.listIndex = 0;
                        $('#dector_preloader_' + self.getNewId).hide();
                        jQuery("#dslist_" + self.getNewId + " ul").empty();
                        self.getmoreDectorStateData();
                        done();
                    }, 1000);
                }
            },
            reInit: function () {
                var self = this;
                self.listIndex = 0;
                if (app.view.current.router.url.indexOf('/moreDectorState/') > -1) { //防止子页面返回触发。有类似的需求可以往这个里面添加
                    $("#page-content_" + self.getNewId).scrollTop(0, 300);
                }
                $("#dslist_" + self.getNewId + " ul").empty();
                if (!self.allowInfinite) {
                    self.allowInfinite = true;
                    $('#dector_preloader_' + self.getNewId).show();
                }
            },
            clearsearch: function (type, typeName) {
                jQuery("#dslist_" + self.getNewId + " ul").empty();
                var self = this;
                self.selectContent = '';
                self.listIndex = 0;
                self.getmoreDectorStateData();
            },
            clearContent: function () {
                if (userInfor.isMuilUnitUser == 0) {
                    if (this.decterSystemId != -1 || this.fcfCategoryId != -1) {
                        $("#dec-search").addClass('search-select');
                    } else {
                        $("#dec-search").removeClass('search-select');
                    }
                } else {
                    if (this.decterOrgId != userInfor.organizationIds || this.decterSystemId != -1 || this
                        .fcfCategoryId != -1) {
                        $("#dec-search").addClass('search-select');
                    } else {
                        $("#dec-search").removeClass('search-select');
                    }
                }
            },
        },
        on: {
            pageInit: function (e, page) {
                var self = this;
                var app = self.$app;
                var $ = self.$$;
                //选择设备类别
                let selectOptionDecEltype = "";
                let dataType = 2;
                self.selectOptionUseIndex = '0'
                //设备类别
                self.getSendCommandFcsCategoryList(function (list) {
                    if (list && list.length > 0) {
                        let htm = []
                        list.forEach(n => {
                            htm.push(
                                `<div class="col" data-value="${n.id}" style="width: auto;margin-right:5px;font-size:14px;">${n.name}</div>`
                                )
                        })
                        jQuery('#unitStat-type-decter_' + self.getNewId).html(htm.join(''))
                        // jQuery("#dector_type_" + self.getNewId).html(list[0].name);
                        // jQuery("#dector_type_" + self.getNewId).addClass('select-active');
                        // self.selectOptionUseIndex = '0'
                        // self.selectViewType(self.firettype);
                    }
                    jQuery('#unitStat-type-decter_' + self.getNewId + ' div').click(function (e) {
                        jQuery('#unitStat-type-decter_' + self.getNewId + ' div').removeClass(
                            'unitStat-type-decter-select')
                        jQuery(e.currentTarget).addClass('unitStat-type-decter-select')
                        self.fcfCategoryId = e.currentTarget.getAttribute('data-value');
                        self.reInit();
                        self.clearContent();
                        self.getmoreDectorStateData();
                    });
                    jQuery('#unitStat-type-decter_' + self.getNewId + ' div').eq(0).click()


                })
                // 设备状态
                jQuery("#dector_type_" + self.getNewId).click(function (e) {
                    let list = [{
                        name: '全部',
                        id: 0
                    },{
                        name: '触发',
                        id: 1
                    }]
                    selectOptionFn(list, function (data) {
                        self.firettype = data.id;
                        jQuery("#dector_type_" + self.getNewId).html(data.name);
                        jQuery("#dector_type_" + self.getNewId).addClass(
                            'select-active');
                        if (self.selectOptionUseIndex != data.index) {
                            self.selectOptionUseIndex = data.index;
                        } else {
                            self.selectOptionUseIndex = "";
                        }
                        self.reInit();
                        self.clearContent();
                        self.getmoreDectorStateData();
                    }, self.selectOptionUseIndex);
                });
                //选择单位
                jQuery("#dector_org_" + self.getNewId).click(function (e) {
                    loadSelectUnitFunc(function (data) {
                        //选中
                        if (self.selectOptionOrg != data.orgId) {
                            self.selectOptionOrg = data.orgId;
                            self.decterOrgId = data.orgId;
                            jQuery("#dector_org_" + self.getNewId).html(data.orgName);
                            jQuery("#dector_org_" + self.getNewId).addClass('select-active');
                            self.selectOptionDec = "";
                            self.decterSystemId = -1;
                        } else {
                            self.selectOptionOrg = "";
                            if (single_Orgid == "") {
                                self.decterOrgId = userInfor.organizationIds;
                            } else {
                                self.decterOrgId = single_Orgid;
                            }
                            jQuery("#dector_org_" + self.getNewId).html("选择单位");
                            jQuery("#dector_org_" + self.getNewId).removeClass('select-active');
                            self.selectOptionDec = "";
                            self.decterSystemId = -1;
                        }
                        self.reInit();
                        self.clearContent();
                        self.getmoreDectorStateData();
                    }, self.selectOptionOrg);
                });
                //搜索
                jQuery("#moreDectorStateSearch_" + self.getNewId).keypress(function (e) {
                    let name = jQuery("#moreDectorStateSearch_" + self.getNewId).val();
                    if (e.which == 13) {
                        self.selectContent = name;
                        $("#dslist_" + self.getNewId + " ul").empty();
                        self.listIndex = 0;
                        self.getmoreDectorStateData();
                    };
                });

                jQuery("#more_decter_unit .select-down").show();
                jQuery("#dector_org_" + self.getNewId).show();

                //单
                if (userInfor.isMuilUnitUser == 0) {
                    jQuery("#dector_org_" + self.getNewId).hide();
                    jQuery("#more_decter_unit .select-down").hide();
                    self.decterOrgId = userInfor.organizationIds; //单联网单位下通过选择探测器实时状态进入
                }
                //多
                else {
                    jQuery("#dector_org_" + self.getNewId).show();
                    //是多联网角色切换到单的
                    if (isChangeUnitRole) {
                        jQuery("#more_decter_unit .select-down").hide();
                        jQuery("#dector_org_" + self.getNewId).hide();
                        self.decterOrgId = single_Orgid;
                    } else {
                        //单位列表进入
                        if (this.$route.params.orgid != 0) {
                            // jQuery("#dector_org_" + self.getNewId).html("中审大厦").addClass('select-active');
                            self.decterOrgId = this.$route.params.orgid;
                            Dao.moreUnitList({
                                userName: userInfor.accountName,
                                deviceId: appKeyObj.deviceId,
                                orgIds: self.decterOrgId,
                                areaId: 0,
                                name: "",
                                provinceId: 0,
                                queryType: 0,
                                pageIndex: 0,
                                pageSize: 1000,
                            }, function (data) {
                                jQuery("#dector_org_" + self.getNewId).html(data[0].name).addClass(
                                    'select-active');
                                if (jQuery("#dector_type_" + self.getNewId)[0].innerText != "设备类别" ||
                                    jQuery("#dector_org_" + self.getNewId)[0].innerText != "选择单位") {
                                    jQuery("#active_" + self.getNewId).addClass("select-active");
                                } else {
                                    jQuery("#active_" + self.getNewId).removeClass("select-active");
                                }
                            });
                        } else {
                            if (single_Orgid == "") {
                                self.decterOrgId = userInfor.organizationIds;
                            } else {
                                self.decterOrgId = single_Orgid;
                            }
                        }
                    }
                }
                //支队用户进入报警
                equipIndex = this.$route.params.fireTType;

                //重现筛选条件
                if (localStorage.getItem("ilink_select_option")) {
                    var selectHistory = JSON.parse(localStorage.getItem("ilink_select_option"));
                    if (selectHistory.page == "remoteControl") {
                        self.decterOrgId = selectHistory.organizationIds;
                        jQuery("#dector_org_" + self.getNewId).html(selectHistory.orgName).addClass(
                            'select-active');
                    }
                }

            },
            pageBeforeOut: function (e, page) {
                var self = this;
                if (self.decterOrgId != userInfor.organizationIds) {
                    let params = {
                        page: 'remoteControl',
                        organizationIds: self.decterOrgId,
                        orgName: jQuery("#dector_org_" + self.getNewId).html(),
                    }
                    saveSelectOption(params);
                }
            },
            pageAfterIn: function (e, page) {
                var self = this;
                keyIssuesListData_rdsp = [];
            }
        }
    }
</script>
<style scoped>
    .unitStat-list-dslist ul:before {
        height: 0 !important;
    }

    /*系统 单位 建筑物*/
    .select-option {
        padding: 10px 5px;
        font-size: 12px;
        z-index: 3;
        position: fixed;
        width: 100%;
        margin-top: 48px;
    }

    .unitStat-no-list {
        height: 100%;
        background-color: rgb(255, 255, 255);
        width: 100%;
        z-index: 3;
        margin-top: 0px !important;
    }

    .maintitle {
        width: 85%;
        padding-left: 5px;
        font-size: 14px;
    }

    .sublinenumber {
        font-size: 12px;
        padding-left: 0px;
    }

    .linenumber {
        color: #333333;
        /*padding-top: 5px;*/
        font-size: 15px;
        padding-left: 0px;
        -webkit-line-clamp: 1;
        display: -webkit-box;
        /*-webkit-box-orient: vertical;*/
        overflow: hidden;
        white-space: nowrap;
        width: 100%;
    }

    .imgicon {
        width: 40px;
        height: 40px;
        border-radius: 5px;
    }

    .img_bqq {
        /*width: 45px;*/
        padding-top: 1.5px;
        height: 17px;
    }

    .global-search {
        background: #fff;
        height: 48px;
        color: #666666 !important;
        font-size: 12px;
        text-align: center;
        line-height: 48px;
    }

    .global-search i {
        font-size: 15px;
        line-height: 48px;
        overflow: hidden;
    }

    .item-title span {
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        font-size: 12px;
    }

    .decter-doing-border {
        border: 1px solid #509dff;
        color: #509dff;
    }

    .decter-doing-border,
    .decter-no-border,
    .decter-yes-border {
        padding: 2px 3px;
    }

    .decter-name {
        font-size: 16px !important;
    }

    .stick {
        position: absolute;
        right: 10px;
        top: 10px;
        z-index: 9999
    }

    .moreDectorState_title {
        padding-right: 20px;
        font-size: 24px;
        font-weight: bold;
        color: #000;
        background-color: #fff;
    }
</style>